import axios from 'axios'

const http = axios.create({
    baseURL: process.env.NODE_ENV === 'development' 
        ? "http://localhost:8080"
        : "https://qiserver.work:8888",
    timeout: 10000,
    withCredentials: true,
});

class XHR {
    constructor() {
        this.interceptors = http.interceptors
    }
    request(config) {
        return http.request(config)
    }
    get(url, config) {
        return http.get(url, config)
    }
    post(url, data, config) {
        return http.post(url, data, config)
    }
}

export default new XHR();